home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / hack99 / linux2.txt < prev    next >
Encoding:
Text File  |  1999-03-24  |  48.3 KB  |  1,124 lines

  1.             Another Paper on Linux Security
  2.  
  3. 13 Aug 98
  4. Last Update 07 Sept 98
  5.  
  6. Bronc Buster
  7. bronc@showdown.org
  8.  
  9. ------------------------------------------------------------------------
  10.  
  11.   Another paper on Linux Security? Why? Well most of the ones I've seen
  12. floating around the net are never complete, only someone's tips or 
  13. tricks on how to secure a part of it, or to tweak some daemon or process 
  14. or a quick fix to a problem. They never cover from step one, though 
  15. going multi-user and going online with users and user processes and all 
  16. that goes along with it. I want to cover that. I know, no matter how 
  17. hard I try, I'll end up missing something, but I'm going to try and 
  18. cover everything I do when I install a system and prepare it for online 
  19. use, plus cover some free tools that I have found to be very effective. 
  20. Now if you are totally clueless and don't have any idea about how to use 
  21. Linux, I'll save you some time and tell you now, just don't go any 
  22. further. To get any use out of this paper, you have to be an 
  23. intermediate user, or a new admin who is familiar with Unix as a whole. 
  24. If you are thinking about going by this list when you are installing 
  25. your system, READ THIS ENTIRE PAPER FIRST, then start over following it, 
  26. otherwise you may miss something you might want when you install or when 
  27. you pick a kernel.
  28.  
  29.   I'll say this now before you start. This paper is ongoing, and a
  30. work in progress. I want to make a comprehensive paper, so I welcome all 
  31. suggestions, tips and advice on how to make this paper a better one.
  32.  
  33. ------------------------------------------------------------------------
  34.    Contents
  35.  
  36. 1. Installation
  37. 2. Boot-Up
  38. 3. SUID files and the File System
  39. 4. Quotas
  40. 5. Logs
  41. 6. Access security (remote and physical)
  42. 7. Misc. Files
  43. 8. Third Party Tools
  44. 9. Conclusions
  45.  
  46.  
  47. ------------------------------------------------------------------------
  48. 1. Installation
  49.  
  50.   This is a step every paper I have seen has over looked. Right from
  51. install you can manage to cut your problems by at least one-third if you
  52. install correctly, installing only what your system needs. Think about 
  53. it. Ask yourself what is this box going to be doing? Is it going to be 
  54. on a LAN as a file server of some sort, or sitting on a direct Internet
  55. Connection as a web server of some sort, or just sitting on your
  56. desk at home running PPP? These are important questions you need to 
  57. answer BEFORE you start your install. 
  58.  
  59.   If this system is going to be sitting on a rack as a web server, why
  60. would you want to install X-Windows, for example. If you're not going to
  61. use it, you'll most likely overlook it in day to day operations, and
  62. that's something a hacker is going to look for. Along with this comes 
  63. SUID programs, programs you might not even know exist, but programs a 
  64. hacker will head for like a shark for blood. On the other hand, if it's 
  65. on a LAN, where you're going to be at the console, and an X-Windows 
  66. server is necessary, look for other components you won't need, like any 
  67. of the PPP or SLIP components.
  68.  
  69. If you're not sure, go out and buy a book, or if you're really poor,
  70. borrow a book. Read up on what each component does and why you need it. 
  71. If worse comes to worse, when you are installing, read each section 
  72. before you just go down the line and check off everything. Read the 
  73. parts which you are unsure of and don't install what you think you don't 
  74. need. Remember that you can always go back later and add things. The 
  75. Unix file system can be very complex and very deep, and hackers depend 
  76. on this when they are hiding programs and backdoors. The better you 
  77. understand what you have put on your system, the better you will know, 
  78. later on, what should be there and what shouldn't. This also helps out 
  79. later on after you have installed, when you are weeding out potential 
  80. security risks. The less unnecessary stuff on yo4ur system, the less you 
  81. have to worry about later on, so take the time now, before an install, 
  82. and go though what you want to install.
  83.  
  84. ------------------------------------------------------------------------
  85. 2. Boot-Up
  86.  
  87.   Ok, so you took a couple hours and got a nice clean install, now 
  88. you're booting up. Hopefully it'll be clean with no errors. If there are 
  89. errors, there are the first problems you want to try and solve. In Linux
  90. (Slackware), there is a directory called '/etc/rc.d' that hold the files
  91. that tells the system what to run at boot. This, as you can imagine, is 
  92. a very important directory, as someone who can write to these files can
  93. install a backdoor, or a process that can be harmful to your system.
  94.  
  95. Back to the errors, and editing each of the files for safety. Most 
  96. people, unless they have experience with Linux, either don't know these 
  97. files exist, don't know what to do with them, or are to scared to touch 
  98. them, thinking back to their uninformed windows95 days, where if you 
  99. touched files that controlled boot-up you might lose everything and have 
  100. to reinstall the operating system. Fear not, this is Linux!
  101.  
  102. showdown:/etc/rc.d# ls -l
  103. total 40
  104. lrwxrwxrwx   1 root     root            4 Jun  5 01:31 rc.0 -> rc.6*
  105. -rwxr-xr-x   1 root     root          396 Oct  2  1995 rc.4*
  106. -rwxr-xr-x   1 root     root         2273 Oct 17  1996 rc.6*
  107. -rwxr-xr-x   1 root     root         1244 May 21  1997 rc.K*
  108. -rwxr-xr-x   1 root     root         3439 Sep 25  1997 rc.M*
  109. -rwxr-xr-x   1 root     root         5054 Jun 16  1997 rc.S*
  110. -rw-r--r--   1 root     root         1336 Jul  9  1997 rc.cdrom
  111. -rwxr-xr-x   1 root     root           52 Jun 12 12:24 rc.httpd*
  112. -rwxr-xr-x   1 root     root         2071 Jul 29 14:19 rc.inet1*
  113. -rwxr-xr-x   1 root     root         2846 Jul  2 20:41 rc.inet2*
  114. -rwxr-xr-x   1 root     root          735 Jun 30 22:10 rc.local*
  115. -rwxr-xr-x   1 root     root         5251 Jun  5 09:23 rc.modules*
  116. -rwxr-xr-x   1 root     root         9059 Aug 23  1997 rc.serial*
  117.  
  118. Now here is a typical '/etc/rc.d/' directory. Each of the 'rc.*' files
  119. does something specific, depending on the status of the system. Some of
  120. them are self-explanatory, like 'rc.httpd', it's simply starts your 
  121. HTTPD web server. The 'rc.cdrom' loads your CD-ROM drive, if you have 
  122. support compiled into your kernel. 'rc.modules' loads modules, if you 
  123. have any (modules are special drivers or programs that are added at 
  124. boot-time to the kernel, and are not compiled into the kernel. Modules 
  125. are uses for older type NICs, sometimes Modems and other old types of 
  126. hardware.) 'rc.serial' is also used for loading serial devices, like 
  127. modems, printer and other stuff. Most of the 'rc.*' files that have 
  128. proper names, like '.cdrom', '.modules', '.serial' and '.httpd' you 
  129. shouldn't have to mess with, as they are set up automatically by the 
  130. choices you make when you install and select a kernel to boot off of. 
  131. Some of the others control the differences between Single Users Mode and 
  132. Multi User Mode, and some of the others control what daemons load up and 
  133. what your operating system can do.
  134.  
  135.   'rc.M' controls the system going to Multi User Mode and loads some of
  136. the other 'rc.*' files if the are supported, like the 'rc.cdrom', etc. 
  137. Go through this file carefully! Anything you know for a fact you don't 
  138. need, EDIT OUT with a '#'. Most likely there won't be too much you have 
  139. to mess with in this file, but you will in the others. Go down the list 
  140. in the 'rc.M' file and look at each of the other 'rc.*' files it runs. 
  141. Then go though each of these files and repeat the process.
  142.   
  143.  For example, say you are going through your 'rc.inet2' file and you 
  144. know you don't need any 'rpc' services and you don't want your 
  145. portmapper to run, so you want to edit this out so it won't start up.
  146.  
  147. #This is how it looks normally. To edit it out, use the '#'
  148.  
  149. -- snip ----
  150. # Start the SUN RPC Portmapper.
  151. if [ -f ${NET}/rpc.portmap ]; then
  152.    echo -n " portmap"
  153.    ${NET}/rpc.portmap
  154. fi
  155. -- snip ----
  156.  
  157. #Here is the correctly edited version
  158.  
  159. -- snip ----
  160. # Start the SUN RPC Portmapper.
  161. #if [ -f ${NET}/rpc.portmap ]; then
  162. #   echo -n " portmap"
  163. #   ${NET}/rpc.portmap
  164. #fi
  165. -- snip ----
  166.  
  167.   It is important to edit it all out, from the starting 'if' all the way
  168. down to the corresponding 'fi' at the end, otherwise you'll end up with
  169. errors. I could go through each of the files and programs started in 
  170. each of the 'rc.*' files, but only you know which ones you are going to 
  171. need, depending on the type of server you are going to run. Just 
  172. remember, you have to assess what you need to get the job done, and then 
  173. remove the rest. If you're not sure what each program does, try doing a 
  174. net search, then reading on what each program does and then assessing if 
  175. you need them or not.
  176.  
  177. The 'rc.local' file is also an important file in the 'rc.d' directory, 
  178. it has any files or program you want to add to be started at boot time. 
  179. You can put any sort of things in here as you will see when I add one a 
  180. bit later.
  181.  
  182.  
  183. ------------------------------------------------------------------------
  184. 3. SUID files and the Filesystem
  185.  
  186.   Before a single user steps fourth into my system, I make sure I find, 
  187. and isolate all, I repeat ALL, SUID files on the entire system. First, 
  188. you need to find all the SUID files. These series of commands will show 
  189. you where they all are:
  190.  
  191. find / -perm 4000 >> suid.txt
  192. find / -perm 4700 >> suid.txt
  193. find / -perm 4777 >> suid.txt
  194. find / -perm 4770 >> suid.txt
  195. find / -perm 4755 >> suid.txt
  196. find / -perm 4750 >> suid.txt
  197. find / -perm 4751 >> suid.txt
  198. find / -perm 4500 >> suid.txt
  199. find / -perm 4555 >> suid.txt
  200. find / -perm 4550 >> suid.txt
  201. find / -perm 4551 >> suid.txt
  202.  
  203.   Now all you have to do is take a quick look into `suid.txt' and you'll 
  204. have the paths to all the SUID files on your system. On some systems, a 
  205. simple `find / -perm 4000 -print >> suid.txt' command will do the same 
  206. thing as all the commands above, but then again I've had a system in 
  207. which it didn't show all the SUID files. So to be safe I use a simple 
  208. script in which it just runs all these commands at once so I don't have 
  209. to sit around typing them all (call me anal).
  210.  
  211.   After you have located all the SUID file, now you have to go though 
  212. all these files and decide which files you need, and which you want your 
  213. users to have access to. On my systems, I leave the following files 
  214. SUID, and `chmod 000' the rest of them.
  215.  
  216. passwd
  217. ping
  218. traceroute
  219. screen
  220. su
  221.  
  222.   All other files that may be SUID, users have no business using, unless 
  223. you are going to run some sort of NFS or an X Server. Keep the list of 
  224. SUID files in your home directory so you can remember later where they 
  225. are if you need to use one. The rest of these SUID files, I move and put 
  226. them in the same directory, so I can keep track of them. Mine are in 
  227. `/usr/local/bin' or in `/bin' so that they stay in the users $PATH. 
  228. Later on I'll go into replacement programs for some of these that are 
  229. even more secure. Remember again, it is up to you, the admin, to decide 
  230. what programs you want users to have access to!
  231.  
  232.  
  233. ------------------------------------------------------------------------
  234. 4. Quotas
  235.  
  236.   I always use quotas! Unless your are a normal ISP, or have some reason 
  237. to limit the amount of space each user is allowed to use, most people 
  238. don't bother with quotas. Well that's the wrong attitude and the wrong 
  239. answer. Quotas can totally save your system from getting trashed and 
  240. hosed from an ignorant or destructive user. Quotas not only control how 
  241. much space a user is allowed to use on your system, but it also controls 
  242. the total number of files (inodes) they are allowed to have as well. 
  243. Think about a user who makes a loop that makes directory after directory 
  244. or 1-byte file after 1-byte file? They could not only eat up all the CPU 
  245. and memory, but fill up your drive. A smart set quota can not only stop 
  246. this before it happens, but stop someone who might not have any quota 
  247. from also filling up your hard drive with garbage files. I've tested a 
  248. Linux 3.0 system (Slack), 2.0.20 kernel, filling its hard drive as full 
  249. as it could go, and upon crashing when any command is input, it would 
  250. not boot upon shutting it down and turning it back on. 
  251.  
  252.   To set up quotas on your system, simply select it when you are 
  253. installing your system. It will install the quota set, which includes 
  254. all the programs needed to get them working. Later on you MUST recompile 
  255. your kernel to support quotas, otherwise they won't work. No, I'm not 
  256. going to go into how to compile you kernel. They have very long HOW-TO's 
  257. on how to do it (do a `find' for Kernel-HOWTO.tar.gz). 
  258.  
  259.   Once quota support is added to your kernel, add these lines to your 
  260. `/etc/rc.local' file at the end:
  261.  
  262. # Quota support and file checks
  263. if [ -x /usr/sbin/quotacheck ]
  264.    then
  265.       echo "Checking quotas. This may take some time."
  266.       /usr/sbin/quotacheck -avug
  267.       echo " Done."
  268. fi
  269.  
  270. # Turning ON quotas
  271. if [ -x /usr/sbin/quotaon ]
  272.    then
  273.       echo "Turning on quota."
  274.       /usr/sbin/quotaon -avug
  275. fi
  276.  
  277. # Done
  278.  
  279.  
  280.   Once you reboot, `quotacheck' will first check your file system and 
  281. make sure no one is over quota, along with other house keeps operations, 
  282. then `quotaon' will turn on quota support for your system. A simple 
  283. command of `quota user' will give you the quotas for a user, or `quota 
  284. group' will give you a set quota for a group. To change a quota, issue 
  285. the command `edquota [user] or [group]'. This will open a temp file with 
  286. your editor, as specified in your `.profile', and give you power to 
  287. change a user, or groups quota. For example:
  288.  
  289.  
  290. showdown:/admin/bronc# edquota tidepool
  291.  
  292. Quotas for user tidepool:
  293. /dev/hda1: blocks in use: 279, limits (soft = 10000, hard = 15000)
  294.         inodes in use: 35, limits (soft = 1300, hard = 1500)
  295.  
  296.  
  297.   From here you can see that this users quota on hda1 is 10megs soft, 
  298. and 15megs hard. Which simple gives the user a grace period to go over 
  299. their quota. If they stay over their quota over the grace period (I use 
  300. 10 days), when they login they can't do anything, except delete files. 
  301. The same goes for their files, or inodes. You can set a soft and hard 
  302. limit on these as well. If these are set to `0' then they have no limit 
  303. (bad idea). 
  304.  
  305.   You can use quotas in various ways to secure against on system 
  306. attacks, and your hard drive getting filled up. If you want to get more 
  307. in depth, try `man quota'. It can tell you it's other functions, how to 
  308. manually start and stop this service and where the quota information is 
  309. stored on your system.
  310.  
  311.  
  312. ------------------------------------------------------------------------
  313. 5. Logs
  314.  
  315.   One of the most important parts of being a good system admin is 
  316. regularly reviewing the systems logs, but if you don't know where they 
  317. are, or what you are logging what use are they? This is a very important 
  318. section and I urge you to read it thoroughly! The only way you are going 
  319. to see if you are being probed for an attack, or if someone has been 
  320. attacking you is by checking the logs.
  321.  
  322.   So where are the logs and how is information sent to them? Well on a 
  323. Linux system, they are located in a directory called `/var/adm/' or in a 
  324. directory called `/var/logs' but usually they are linked together. By 
  325. default, there are only two logs, `syslog' and `messages' but we need to 
  326. make more. Logs are made from two daemons, `klogd' and `syslogd'. 
  327. `klogd' intercepts and logs Linux kernel messages, while `syslogd' logs 
  328. all system messages. These are system daemons which are automatically 
  329. started by your `rc.*' files upon boot. To configure what you log, you 
  330. must edit a file called `/etc/syslog.conf', this file tells what 
  331. `syslogd' is to log, and where it is to put it. Here is how I have mine 
  332. set up:
  333.  
  334.  
  335. # /etc/syslog.conf file
  336. # for more information about this file, man `syslog.conf' or `sysklogd'
  337. #
  338. # Modified by Bronc Buster
  339. mail.none;*.=info;*.=notice                     /usr/adm/messages
  340. *.=debug                                        /usr/adm/debug
  341. *.err                                           /usr/adm/syslog
  342. *.=alert                                        root,bronc
  343. *.=emerg                                        root,bronc
  344. authpriv.*;auth.*                               /admin/bronc/auth.log
  345. authpriv.*;auth.*                               /var/log/secure
  346. mail.info;mail.notice                           /var/log/maillog
  347. daemon.info;daemon.notice                       /var/log/daemon.log
  348. *.*                                             /dev/tty12
  349.  
  350. # EOF
  351.  
  352.   Ok, if you don't know how this file is formatted and what phrases to 
  353. use here, read up on the man page, `man syslog.conf'. I don't want to go 
  354. through and waste two or three pages on explaining it. Lets go through 
  355. my file line by line and see how it works. I wanted to make my logs 
  356. simple, easy to understand and be specific as to what they have in them. 
  357. First, my `messages' file was getting full of junk errors from my mail 
  358. program, so I went and took out all messages associated with mail; i.e. 
  359. `mail.none'. Then I wanted all messages at the `info' or `notice' level 
  360. to be placed into it, so I added that into the same line as well. Next, 
  361. I wanted all `debug' messages, sent to their own file, as well as all 
  362. `err' (error) messages. Any `alert' or `emerg' (emergency) messages I 
  363. wanted sent to the console or the terminal I was logged on, so I would 
  364. know about them as soon as possible. The nest two lines have to do with 
  365. connections and possible logins. I wanted to have a file that had 
  366. nothing but who and when, so I could easily check out who logged in and 
  367. when, and I also wanted an extra copy put in my own home directory so 
  368. incase someone somehow edited it and took themselves out, I'd still have 
  369. my own copy plus when I wanted to take a look at it, it was easily 
  370. viewable. That's what the lines with the `authpriv' and `auth' are 
  371. doing. The first one puts the log in my directory, the second in the 
  372. normal logging directory. The next line deals with all the mail messages 
  373. that I took out of the first `messages' file and puts them in their own 
  374. log file. Nothing but mail here, so there is nothing else in there to 
  375. confuse you. The `daemon' line logs all messages regarding the system 
  376. daemons, and, like the mail line above, nothing else so there is nothing 
  377. to get confused over. The last line is also a very important one. It 
  378. sends all logs to /dev/tty12, so even if your logs were to get deleted, 
  379. from the console you can hit Ctrl-F12 and see the last page of messages 
  380. so you can get an idea of what happened. These different logs each cover 
  381. a different aspect of your system, and keep them unscrambled and easy to 
  382. read through. Remember, the easier the better.
  383.  
  384.   If I had another box I could use, I would also pipe all the logs off 
  385. my box to the other box. With syslog, you have the option of sending all 
  386. the logs off your box for remote logging. You could put a poor old 386, 
  387. with Linux, on your network with nothing running but `inetd' and 
  388. `syslogd' and send all your systems logs over to it with this simple 
  389. line in your `syslog.conf':
  390.  
  391.  
  392. # log ALL            other boxes IP number
  393. #
  394. *.*                @<boxes IP here>
  395.  
  396.  
  397.   Now that your main system logs are secure, what about other log files? 
  398. You still have `/var/log/wtmp' and `/var/log/utmp', plus each users 
  399. shell histories. Because on some systems, `cron' archives your system 
  400. logs, you normally can't `chattr' them, or mess with them much, but you 
  401. can on the other logs. `chattr' changes a files attributes on an EXT2 
  402. file system, like you are using on your Linux system. With this command, 
  403. you can make a file so it can't be deleted or edited, except to be 
  404. appended (`man chattr' for more info on this useful command). This magic 
  405. command can make the `wtmp' and `utmp' file so it can only be appended 
  406. to, and so it can't be deleted or changed so as to show a user never 
  407. logged on, or where they logged on from. With this same command, you can 
  408. also fix all the users shell histories. Normally, any shell histories 
  409. made by each user, are owned by each user, making them totally useless 
  410. as a skilled user will first thing, link it to `/dev/null'. By using the 
  411. `chattr +a' option of the `chattr' command on `wtmp', `utmp' and each 
  412. users shell histories, you can track down problems quickly. I don't know 
  413. how many troublesome users I have tracked down simply going into their 
  414. shell histories and looking for problems they have caused. Like here is 
  415. an example:
  416.  
  417. --- snip ---
  418. gcc smurf.c -o smurf
  419. smurf <IP edited out>
  420. smurf <IP edited out>
  421. gcc octpuss.c -o octop
  422. octop <IP edited out>
  423. ping <IP edited out>
  424. ping -s 2000 <IP edited out>
  425. rm smurf* 
  426. rm otc*
  427. rm .bash_history
  428. rm .bash_hirtory
  429. vi .bash_history
  430. exit
  431. logout
  432.  
  433.   This, soon removed user, was using denial of service attacks to attack 
  434. another system, and in return they were attacking us. Users like this 
  435. can get you, the admin, in hot water and need to be removed as soon as 
  436. possible. If it wasn't for the fact I `chattr +a' all the users shell 
  437. histories, I never would have tracked it down to a specific user. When I 
  438. add a user, I use a modified the `adduser' script so it automatically 
  439. `chattr +a' their shell histories. To do the same, simply open the 
  440. `adduser' script with an editor and add these lines at the end:
  441.  
  442. # chattr +a users shell histories
  443. if [ -d $HME ]; then
  444.   chmod 711 $HME
  445.   cd $HME
  446.   /bin/touch .bash_history
  447.   /bin/chown $LOGIN:users .bash_history
  448.   /usr/bin/chattr +a .bash_history
  449.   /bin/touch .ksh_history
  450.   /bin/chown $LOGIN:users .ksh_history
  451.   /usr/bin/chattr +a .ksh_history
  452.   /bin/touch .sh_history
  453.   /bin/chown $LOGIN:users .sh_history
  454.   /usr/bin/chattr +a .sh_history
  455. fi
  456.  
  457.  
  458.   You need to keep close tabs on your log files, they are your eyes and 
  459. ears of your system. You need to make them secured, easy to read and 
  460. make sure they cover all aspects of what the system logging daemons can, 
  461. and are logging.
  462.  
  463.  
  464. ------------------------------------------------------------------------
  465. 6. Access Security (remote and physical)
  466.  
  467.   Access is an often-overlooked part of the total security picture. Both 
  468. remote and physical access must be dealt with. It takes more than a 
  469. strong password to keep people off your system, you have to know what 
  470. files to use to control access even if someone were to get a valid login 
  471. and password. There are files in your system that can gratefully help 
  472. and give you stronger control over who connects, as there are also files 
  473. that don't exist and that you need to make that can also help with local 
  474. controls as well. Here are the files we are going to cover then we will 
  475. go onto physical access controls:
  476.  
  477. /etc/suauth
  478. /etc/ftpaccess
  479. /etc/hosts.deny
  480. /etc/hosts.allow
  481. /etc/securetty
  482.  
  483.  
  484.   First, `suauth', it is the file that controls who is allowed to use 
  485. the `su' (Switch User) command. This command, as you know, lets you 
  486. become a root user, or lets you become any other user for that matter 
  487. and is SUID, so you want to keep a tight grip on who is allowed to use 
  488. it. The `suauth' file has a certin format, being:
  489.  
  490. TO:FROM:ACTION
  491.  
  492.   Simple looking enough. The `TO' field tells what user you are going 
  493. to, in this case, say `root'. The `FROM' field controls which user or 
  494. group is being applied to go `TO' root. The `ACTION' tells what to do in 
  495. each case. `ACTION's that can be used are, `OWNPASS', `DENY' and 
  496. `NOPASS'. Here is a clipping out of the `suauth' man page so you can get 
  497. a better feeling of how these all tie together.
  498.  
  499.        
  500.        # A couple of privileged usernames may
  501.        # su to root with their own password.
  502.        #
  503.        root:chris,birddog:OWNPASS
  504.        #
  505.        # Anyone else may not su to root unless in
  506.        # group wheel. This is how BSD does things.
  507.        #
  508.        root:ALL EXCEPT GROUP wheel:DENY
  509.        #
  510.        # Perhaps terry and birddog are accounts
  511.        # owned by the same person.
  512.        # Access can be arranged between them
  513.        # with no password.
  514.        #
  515.        terry:birddog:NOPASS
  516.        birddog:terry:NOPASS
  517.        #
  518.  
  519.   On my system, I have done what is in the second example. I edited the 
  520. `/etc/group' file and added another group called `wheel'. This group is 
  521. somewhere between the group `users' and `root', and I then added the 
  522. users to this group that I wanted to be allowed to `su'. In the `suauth' 
  523. file, I simply told it not to allow anyone to `su' unless they are in 
  524. the group `wheel'. One down. Need any more help, try `man suauth'.
  525.  
  526.   Next is the `ftpaccess' file. This file controls a lot of stuff 
  527. regarding your ftp services, like who can upload and download, if 
  528. anonymous connections are allowed and if there are any hosts you don't 
  529. want connecting at all. Because this file controls so much, I'm only 
  530. going to get into how to block hosts from connecting, as I am dealing 
  531. with access control, so for more information on how to set up other 
  532. features in this file, as always `man ftpaccess'. Now this file has a 
  533. simple rule set, and is not very picky in where you place things in it. 
  534. For example, if we were going to add someone to our deny list, we could 
  535. add it at the very top, the middle or the end and it won't care. I 
  536. usually add them to the bottom as you want room to keep adding. The 
  537. format is a very simple one, `deny <ip or domain> <message file>'. Here 
  538. is how mine looks:
  539.  
  540. # deny these domains from getting on my FTP site
  541. #
  542. #deny      host                    path to nasty message
  543. #
  544. deny    *.sekurity.org                /etc/msgs/msg.dead
  545. deny    *.303.org                     /etc/msgs/msg.dead
  546. dent    *.tacd.org                    /etc/msgs/msg.dead
  547. deny    *.dim.com                     /etc/msgs/msg.dead
  548. deny    *.comsite.net                 /etc/msgs/msg.dead
  549. deny    su1d.technotronic.com         /etc/msgs/msg.dead
  550.  
  551.  
  552.   I think it's very easy to understand the format of this file, except 
  553. maybe the last part, `/etc/msgs/msg.dead'. This is simply a path to a 
  554. text file you want to be shown the person who is denied. Anyone 
  555. connecting and getting access into the system, or getting denied, will 
  556. show up in your log files (/var/logs/secure) so remember to check them 
  557. from time to time if you notice any funny activity.
  558.  
  559.   The `hosts.deny' and `hosts.allow' files work hand in hand with each 
  560. other and are, by default, used on almost all-modern versions of Unix. 
  561. These files work in conjunction with TCP Wrappers, which you are most 
  562. likely using now if you know it or not. TCP Wrappers, in brief, is a 
  563. program called `tcpd'. From the man page, it monitors incoming requests 
  564. for telnet, finger, ftp, exec, rsh, rlogin, tftp, talk, comsat and other 
  565. services that have a one-to-one mapping onto executable files. What does 
  566. that mean? Well in short, it watches programs that are in your 
  567. `/etc/inetd.conf' file which are the programs that are started by 
  568. `inetd' when in incoming request asks for an assigned program it watches 
  569. for. The `tcpd' program is put into the `inetd.conf' file in place of 
  570. the normal programs and whenever a request for service arrives, the 
  571. inetd daemon is tricked into running the `tcpd' program instead of the  
  572. desired server. `tcpd' logs the request and does some additional checks. 
  573. When all is well, `tcpd' runs the appropriate server program and goes 
  574. away. If you look at your `/etc/inetd.conf' file a line should like 
  575. similar to this:
  576.  
  577.  
  578. smtp  stream  tcp     nowait  root    /usr/sbin/tcpd  sendmail -bs
  579.  
  580.  
  581.   Here you can see that my `tcpd' is started, instead of sendmail, when 
  582. an incoming request it sent to my smtp port. `tcpd' then logs the 
  583. request and checks your `hosts.deny' and `host.allow' files. The 
  584. `hosts.*' files do what their names suggest. They allow, or deny 
  585. connections. Their formats are very easy to use; Connection:IP address.
  586.  
  587.  
  588. showdown:~$ cat /etc/hosts.deny
  589. ALL:  130.85.3.8
  590. ALL:  207.172.56.57
  591.  
  592.  
  593.   Here I am blocking ALL connections from these two IP numbers. If I 
  594. wanted I could block the entire class C, or change it to a domain and 
  595. block that. You can put as many IP in here as you want, or if you are 
  596. super paranoid, you can even put `ALL:ALL' and deny all connections.
  597.  
  598.   If you deny everyone, you can then select hosts to allow connections 
  599. from. This is when you would use your `hosts.allow' file. It has the 
  600. same format as the deny file, but unless you deny `ALL:ALL' I've never 
  601. had to use it. But whose to say what your security needs are. Maybe you 
  602. only want a select few people to be allowed to connect to your box. If 
  603. so this is how you would do it. As most of the other files, they can 
  604. also be tweaked a bit more and have other options. To get more 
  605. information on them, `man tcpd'.
  606.  
  607.   Lastly, we will go over another simple, but surpassingly often 
  608. overlooked file. The `/etc/securetty' file simply controls where `root' 
  609. can log in from. As it comes default, it allows root to log in from any 
  610. tty, local or remote. Here is the default:
  611.  
  612.  
  613. console
  614. tty1
  615. tty2
  616. tty3
  617. tty4
  618. tty5
  619. tty6
  620. ttyS0
  621. ttyS1
  622. ttyS2
  623. ttyS3
  624. ttyp0
  625. ttyp1
  626. ttyp2
  627. ttyp3
  628.  
  629.  
  630.   That's all it is. If you had no idea what this file did how would you 
  631. know (`man securetty' maybe)? These are the `/dev/tty's that are on your 
  632. system, remote and local. The `ttyp*' and the `ttyS*' are remote, and 
  633. the rest, as you can guess are local at the console. You, I hope, want 
  634. to keep anyone from logging on as `root' anywhere, except from the local 
  635. tty's. To do this, simply edit this file and comment out all the remote 
  636. tty's with the `#' like so:
  637.  
  638. #Keep root from logging on with a remote /dev/tty
  639. console
  640. tty1
  641. tty2
  642. tty3
  643. tty4
  644. tty5
  645. tty6
  646. #ttyS0
  647. #ttyS1
  648. #ttyS2
  649. #ttyS3
  650. #ttyp0
  651. #ttyp1
  652. #ttyp2
  653. #ttyp3
  654.  
  655.  
  656.   That's that for remote access security. Now I'll move onto physical 
  657. access. Now most places your box is going to be will be secure by the 
  658. nature of place it is. If it is at your ISP, then most likely it is 
  659. secure. If it's co-located, the people at your ISP most likely know you 
  660. and know you box, plus if your box is with theirs, I'm sure they don't 
  661. want anyone back with their machines as much as you don't. If It's on a 
  662. LAN, keep it locked in your office, or if that's not possible, try and 
  663. keep it under a desk or on the floor out of the way where no one will 
  664. notice it. While you can't count on `security through obscurity' online, 
  665. in physical access you want to use it. My box at my ISP is on the bottom 
  666. rack next to 4 other machines that look similar to mine, all with no 
  667. monitors and only keyboards attached (for remote reboots). There are no 
  668. labels or any identifying marks at all. It is out of the way and very 
  669. inconspicuous. If someone is going to go into the place your box is 
  670. stored, you don't want to make it easy to identify, or find for that 
  671. matter. Make them have to hook up a monitor and check each box until 
  672. they find yours. Hopefully they will get discouraged or get cough by 
  673. then. 
  674.  
  675.   A very important note and common sense: NEVER walk away from the 
  676. console and leave root logged in, or any user for that matter. Log out, 
  677. or lock the terminal!
  678.  
  679.   As far as other physical security measures, well if it's sitting in 
  680. your house, what can you do besides lock your doors. If it's at your 
  681. ISP, you have to rely on them. If it's at work, keep it out of sight or 
  682. locked up. Just be smart. Keep the console locked. Don't leave a monitor 
  683. hooked up to it if it's not at your house. If someone wants to get to 
  684. it, it's not like it's going to be kept in some top-secret lab 
  685. somewhere, they are going to get to it. If they do, try and make it so 
  686. the most damage they can do is to simply turn it off.
  687.  
  688.  
  689. ------------------------------------------------------------------------
  690. 7. Misc. Files
  691.  
  692.   Now I am going to cover the other files around the system that don't 
  693. fall under the other categories I've went through so far. There are only 
  694. a few, but they are an important few. These files are:
  695.  
  696. /etc/inetd.conf
  697. /etc/services
  698. /etc/nologin
  699. /etc/issue.net and /etc/issue
  700. /etc/passwd
  701. /etc/shadow
  702. /etc/group
  703.  
  704.   First, the `inetd.conf' file. This file is the configuration file for 
  705. your `inetd' daemon. This daemon listens for connections on certain 
  706. ports for and then decides what service to invoke, if any as told to it 
  707. by the `inetd.conf' file. As you can imagine, this is an important file 
  708. as whatever services are in it can be invoked by it. As default, all the 
  709. services in it are open. I guess the writers of it though we were living 
  710. in lollypop land and everyone was friendly, but unfortunately it's not. 
  711.  
  712.   To edit this file, as with the ones before, you use `#'. You're 
  713. `inetd.conf' file should look similar to this one before being edited:
  714.  
  715.  
  716. -------- snip ---------
  717.  
  718. # The first 4 services are really only used for debugging purposes, so
  719. # we comment them out since they can otherwise be used for some nasty
  720. # denial-of-service attacks.  If you need them, uncomment them.
  721.  echo          stream  tcp     nowait  root    internal
  722.  echo          dgram   udp     wait    root    internal
  723.  discard       stream  tcp     nowait  root    internal
  724.  discard       dgram   udp     wait    root    internal
  725.  daytime       stream  tcp     nowait  root    internal
  726.  daytime       dgram   udp     wait    root    internal
  727.  chargen       stream  tcp     nowait  root    internal
  728.  chargen       dgram   udp     wait    root    internal
  729. time    stream  tcp     nowait  root    internal
  730. time    dgram   udp     wait    root    internal
  731. #
  732. # These are standard services.
  733. #
  734. ftp     stream  tcp     nowait  root    /usr/sbin/tcpd  wu.ftpd -l -i -a
  735. telnet  stream  tcp     nowait  root    /usr/sbin/tcpd  in.telnetd
  736. #
  737. #
  738. # Use this one instead if you want to snoop on telnet users (try to use 
  739. this
  740. # for ethical purposes, ok folks?) :
  741. # telnet stream  tcp     nowait  root    /usr/sbin/tcpd 
  742. /usr/sbin/in.telnetsnoopd
  743. #
  744. # This is generally unnecessary.  The daemon provided by INN will handle 
  745. the
  746. # incoming NNTP connections.
  747.  nntp  stream  tcp     nowait  root    /usr/sbin/tcpd  in.nntpd
  748. #
  749.  
  750. ----- snip -----
  751.  
  752. smtp  stream  tcp     nowait  root    /usr/sbin/tcpd  sendmail -bs
  753. #
  754. # The comsat daemon notifies the user of new mail when biff is set to y:
  755. comsat        dgram   udp     wait    root    /usr/sbin/tcpd  in.comsat
  756. #
  757. # Shell, login, exec and talk are BSD protocols.
  758. #
  759. shell  stream  tcp     nowait  root    /usr/sbin/tcpd  in.rshd -L
  760. login  stream  tcp     nowait  root    /usr/sbin/tcpd  in.rlogind
  761. exec  stream  tcp     nowait  root    /usr/sbin/tcpd  in.rexecd
  762. talk    dgram   udp     wait    root    /usr/sbin/tcpd  in.talkd
  763. ntalk   dgram   udp     wait    root    /usr/sbin/tcpd  in.talkd
  764. # Kerberos authenticated services
  765. #
  766. # klogin    stream  tcp     nowait  root    /usr/sbin/tcpd  rlogind -k
  767. # eklogin   stream  tcp     nowait  root    /usr/sbin/tcpd  rlogind-k -x
  768. # kshell        stream  tcp     nowait  root    /usr/sbin/tcpd  rshd -k
  769. #
  770. # Services run ONLY on the Kerberos server
  771. #
  772. # krbupdate stream  tcp     nowait  root    /usr/sbin/tcpd   registerd
  773. # kpasswd   stream  tcp     nowait  root    /usr/sbin/tcpd  kpasswdd
  774. #
  775. # Pop et al
  776. #
  777.  pop2  stream  tcp     nowait  root    /usr/sbin/tcpd  in.pop2d
  778.  pop3  stream  tcp     nowait  root    /usr/sbin/tcpd  in.pop3d
  779. # The ipop3d POP3 server is part of the Pine distribution.  If you've
  780. # installed the Pine package, you may wish to switch to ipop3d by 
  781. # commenting out the pop3 line above, and uncommenting the pop3 line 
  782. below.
  783. pop3    stream  tcp     nowait  root    /usr/sbin/tcpd  ipop3d
  784. imap2   stream  tcp     nowait  root    /usr/sbin/tcpd  imapd
  785. #
  786. # The Internet UUCP service.
  787. #
  788.  uucp  stream  tcp  nowait  uucp /usr/sbin/tcpd /usr/lib/uucp/uucico-l
  789. #
  790. # Tftp service is provided primarily for booting.  Most sites
  791. # run this only on machines acting as "boot servers." 
  792. #
  793.  tftp  dgram   udp     wait    nobody  /usr/sbin/tcpd  in.tftpd
  794. # bootps dgram   udp  wait root /usr/sbin/in.bootpd     in.bootpd
  795. #
  796. # Finger, systat and netstat give out user information which may be
  797. # valuable to potential "system crackers."  Many sites choose to disable 
  798. # some or all of these services to improve security.
  799. # Try "telnet localhost systat" and "telnet localhost netstat" to see 
  800. # that
  801. # information yourself!
  802. #
  803. finger  stream  tcp     nowait  nobody  /bin/sbin/tcpd  in.fingerd
  804. systat  stream  tcp     nowait  nobody  /usr/sbin/tcpd  /bin/ps -auwwx
  805. netstat stream  tcp     nowait  root    /usr/sbin/tcpd  /bin/netstat-a
  806. #
  807. # Ident service is used for net authentication
  808. auth stream  tcp  wait root /usr/sbin/in.identd in.identd -w-t1 20 -l
  809. #
  810. #
  811. # These are to start Samba, an smb server that can export filesystems to
  812. # Pathworks, Lanmanager for DOS, Windows for Workgroups, Windows95, 
  813. #Lanmanager
  814. # for Windows, Lanmanager for OS/2, Windows NT, etc.  
  815. # If you're running smbd and nmbd from daemons in /etc/rc.d/rc.samba, 
  816. #then you
  817. # shouldn't uncomment these lines.
  818.  netbios-ssn     stream  tcp     nowait  root    /usr/sbin/smbd  smbd
  819.  netbios-ns      dgram   udp     wait    root    /usr/sbin/nmbd  nmbd
  820. #
  821. # Sun-RPC based services.
  822. # <service name/version><sock_type><rpc/prot><flags><user><server><args>
  823. # rstatd/1-3 dgram rpc/udp wait root    /usr/sbin/tcpd  rpc.rstatd
  824. # rusersd/2-3 dgram rpc/udp wait root    /usr/sbin/tcpd  rpc.rusersd
  825. # walld/1   dgram   rpc/udp wait    root    /usr/sbin/tcpd  rpc.rwalld
  826. #
  827. # End of inetd.conf.
  828.  
  829.  
  830.   This is a cut down version, but should look very similar to yours. You 
  831. need to take some of these services out; the ones you don't use and the 
  832. ones you don't need. Some of them tell you what they are used for, 
  833. others don't. You need to go through and see what services you need, and 
  834. what you don't.
  835.  
  836.   For a normal server, I have almost all these services edited out, as 
  837. they are not used or pose security risks. Here are the services I left 
  838. open in mine:
  839.  
  840. time    stream  tcp     nowait  root    internal
  841. time    dgram   udp     wait    root    internal
  842. ftp     stream  tcp     nowait  root    /usr/sbin/tcpd  wu.ftpd -l -i -a
  843. telnet  stream  tcp     nowait  root    /usr/sbin/tcpd  in.telnetd
  844. smtp    stream  tcp     nowait  root    /usr/sbin/tcpd  sendmail -bs
  845. talk    dgram   udp     wait    root    /usr/sbin/tcpd  in.talkd
  846. ntalk   dgram   udp     wait    root    /usr/sbin/tcpd  in.talkd
  847. auth  stream  tcp wait root  /usr/sbin/in.identd  in.identd -w -t1 20 -l
  848.  
  849.   All the other services I don't use, or can do without. These are 
  850. essential services that are needed for a server that has users on it. 
  851. These are services they need so they may connect, send mail, and other 
  852. basic user activities (ftp, telnet, smtp, talk, ntalk), plus a few other 
  853. to help me verify connections (auth). All the others you can edit out 
  854. without fear of cutting off users or hurting the system.
  855.  
  856.   I also modified my finger service a bit. I usually have it turned off, 
  857. but for fun I did this:
  858.  
  859.  
  860. finger  stream  tcp     nowait  nobody  /bin/cat cat /etc/finger.txt
  861.  
  862.  
  863.   All this does is, instead of returning the normal `finger' 
  864. information, is echo a file, the file `/etc/finger.txt', back to the 
  865. person who has fingered your system. You can put whatever you want to be 
  866. in the `finger.txt' file, so have a bit of fun with it :).
  867.  
  868.   The `/etc/services' file lists the ports on your system that have 
  869. services connected to them. Think of them like a bunch of open windows 
  870. that you can go through. You want to close all the windows you're not 
  871. using or watching because most remote exploits are run on ports that are 
  872. running some obscure service that no one thinks about or uses. If you 
  873. take a look at this file, you'll see it's quite large. It lists port 
  874. numbers with the protocol and the service on each port. You can also 
  875. edit out ports with the `#' in this file. Here is the man pages 
  876. definition: `services' is a plain ASCII file providing a mapping between 
  877. friendly textual names for internet  services,  and  their underlying 
  878. assigned port numbers and protocol types. Every networking program 
  879. should look into this file to get the port number (and protocol) for its 
  880. service. 
  881.  
  882.   Instead of showing you all the ports, I'll show you what ports I have 
  883. open, and you can see how they correspond to my `inetd.conf'.
  884.  
  885.  
  886. netstat         15/tcp
  887. ftp             21/tcp
  888. ssh             22/tcp          #Secure SHell
  889. telnet          23/tcp
  890. smtp            25/tcp          mail
  891. time            37/tcp          timserver
  892. time            37/udp          timserver
  893. whois           43/tcp          nicname
  894. finger          79/tcp
  895. www             80/tcp          http    # WorldWideWeb HTTP
  896. www             80/udp                  # HyperText Transfer Protocol
  897. auth            113/tcp         tap ident authentication
  898. talk            517/udp
  899. ntalk           518/udp
  900.  
  901.  
  902.   As you can see, the majority of the ports do not need to be open. You 
  903. need to run the minimum number of ports to get the job done. If you're 
  904. not sure if what a port does, try using `man' and checking what the 
  905. service is. You can even block a port and see how it goes, then, if 
  906. needed, come back and unblock it later. One note you want to remember. 
  907. If the service is open in the `inetd.conf' file, then you also want it 
  908. to be open in this file as well.
  909.  
  910.   The next file is `/etc/nologin'. This file may be useful when you need 
  911. to lockdown the system to find a problem where you need all the users 
  912. off the system, track down a problem user or stop a hacker in progress. 
  913. By simply making a file called `nologin', or what is commonly done is 
  914. `mv'ing the `motd' file, no non-root users will be allowed to log on to 
  915. the system. The system will let them log on, it will then echo to them 
  916. whatever is in the `nologin' file, then terminate their connection. 
  917.  
  918.  
  919.   The `/etc/issue.net' and the `/etc/issue' files can be important in 
  920. taking away a good way of getting information on your system. A lot of 
  921. people will simply telnet to a system and look at the login prompt to 
  922. see what type of operating system is running. By changing the `issue' 
  923. file instead of telnet showing this:
  924.  
  925.  
  926. Welcome to Linux 2.0.35.
  927. Showdown login:_
  928.  
  929.  
  930.   You can make it show whatever you want. Both of these files are plain 
  931. ASCII files. Simply edit it and put in whatever you want:
  932.  
  933.  
  934. \__ ^^ __/     
  935.    X  X 
  936.    \  /                     
  937.     \/
  938.  
  939. Welcome to eLe3t mIcRoSoFt uNiX v6.66
  940. Showdown login:_
  941.  
  942.  
  943.   The `/etc/passwd', `/etc/shadow' and the `/etc/group' files I hope you 
  944. already know are very important files. They hold the power is the system 
  945. and tells the system, who is who and who has the power to do what. I 
  946. hope, as you are the admin of a box, you know how important these files 
  947. are. You need to insure the passwords are strong, that there are no 
  948. users with no passwords, there are no other users except root with the 
  949. UID of 0 and that the permission on the files are set correctly. By 
  950. default the permissions are correct, so don't change them. The Shadow 
  951. Suite takes good care of things though security wise, so besides these 
  952. simple things, you don't have to worry much about them. Take a chance to 
  953. look through all three of these files and familiarize yourself with them 
  954. so you can spot a problem if one were to appear.
  955.  
  956.  
  957. ------------------------------------------------------------------------
  958. 8. Third Party Tools
  959.  
  960.   Well this part I threw in because I have found some free tools 
  961. floating around the net that are extremely useful. Some of these tools 
  962. are `must gets'.
  963.  
  964.  
  965. SSH 
  966.  
  967.   If you are not running SSH, you need to be. SSH uses keys, similar to 
  968. PGP, to authenticate logins and then encrypts the session both to and 
  969. from the server. Someone running a network packet sniffer can very 
  970. easily capture logins and passwords from another unsecured machine on 
  971. your LAN, but not if you use SSH. Most newer SSH clients support vt100 
  972. and all the cool ASCII colors, and such so by getting it, you're not 
  973. losing anything, but your gaining a piece of mind and some real 
  974. security. 
  975.  
  976.   You can get SSH and read more about it at:
  977.  
  978. SSH FAQ's - http://www.uni-karlsruhe.de/~ig25/ssh-faq/
  979. FiSSH, Free SSH Win95/NT client - http://www.massconfusion.com/ssh/
  980. SSH Club FI - http://www.cs.hut.fi/ssh/
  981.  
  982.  
  983. Sentry
  984.  
  985.   Although still in Beta form, this is a super useful program I now run 
  986. on all my systems. Here is a clipping from its README file to briefly 
  987. tell what it does:
  988.  
  989. The Sentry is part of the Abacus Project suite of tools. The Abacus 
  990. Project is an initiative to release low-maintenance, generic, and 
  991. reliable host based intrusion detection software to the Internet 
  992. community. 
  993.  
  994.   This program listens to ports, you designate, and takes actions 
  995. depending on different rules you set for it. This is to give you a heads 
  996. up that someone may be probing your system, or launching DoS attacks 
  997. against it. It can log the activity, can add the offending hosts to the 
  998. `/etc/hosts.deny' file, the local system can be automatically re-
  999. configured to route all traffic to the target to a dead host to make the 
  1000. target system disappear and it can also be re-configured to drop all 
  1001. packets from the host via a local packet filter.
  1002.  
  1003.   All and all it's a program I think you need to install, understand and 
  1004. use.
  1005.  
  1006.   You can get more information and get Sentry at:
  1007.  
  1008. Sentry Abacus Project - http://www.psionic.com/abacus/abacus_sentry.html
  1009.  
  1010.  
  1011. Logcheck
  1012.  
  1013.   This tool is also part of the Abacus Project and is a must get. When 
  1014. used in conjunction with SSH and Sentry, it can keep you easily informed 
  1015. to the happenings around your system. This program, via cron, checks 
  1016. your logs on a timed basis looking for certain key words that can 
  1017. trigger a level of alert. Like Sentry, you set the rules as to what it 
  1018. looks for and what it does, and it's easily configurable. It can do 
  1019. simple things like e-mail you, or echo to your console or even shut down 
  1020. the system depending on what rules you give it.
  1021.  
  1022.   You can get more information and get Logcheck at:
  1023.  
  1024. Logcheck Abacus Project -
  1025. http://www.psionic.com/abacus/abacus_logcheck.html
  1026.  
  1027.  
  1028. Secure Ping v1.0
  1029.  
  1030.   This is a secure replacement for the normal `ping' program on your 
  1031. system. `ping' is often abused by users trying to icmp other hosts with 
  1032. the feared pings-of-death and the like. This program limits both users 
  1033. and root as to the sizes of packets and the number of packets that can 
  1034. be sent. If someone tried to abuse Secure Ping, it simply tells the user 
  1035. to take a hike and then sends a line to the log files which Logcheck 
  1036. then picks up later and tells you about.
  1037.  
  1038.   You can get more information and get Secure Ping at:
  1039.  
  1040. Secure Ping - http://www.sy.net/security
  1041.  
  1042.  
  1043. Smurf Logger v1.1
  1044.  
  1045.   This program does what its name says. It logs ICMP Smurf attacks. 
  1046. Unlike a normal ICMP Ping logger, this won't fill up your hard drive 
  1047. with meg after meg of logs. It logs repeat attacks with one line. This 
  1048. is also a nice program to have so you can see if your box is getting hit 
  1049. or not, and then take actions to block it at the router level.
  1050.  
  1051. You can get more information and get Smurf Logger v1.1 at:
  1052.  
  1053. Smurf Logger - http://www.sy.net/security
  1054.  
  1055.  
  1056. Tripwire
  1057.  
  1058.   Tripwire is a tool to use just incase your system has been breached. 
  1059. Once installed correctly, with a correct config file, this program will 
  1060. look at all the files on your system, see their sizes and their dates 
  1061. then, whenever you want, will recheck them to see if they match. This is 
  1062. a good way to find out if a file has been tampered with, trojened or 
  1063. backdoored. The only draw back is that you need to keep a read-only 
  1064. floppy in the floppy drive.
  1065.  
  1066.   You can get more information and get Tripwire at:
  1067.  
  1068. COAST Archives - ftp://coast.cs.purdue.edu/pub/COAST/Tripwire
  1069.  
  1070.  
  1071. Lsof
  1072.  
  1073.   This handy file checks for files on the system that are open. They can 
  1074. either be legit files that are opened, like eggdrop files, or they can 
  1075. be files that someone `forgot' to close and is eating up 100% CPU. This 
  1076. is another handy file to have in your arsenal.
  1077.  
  1078. Prudue Unix Tools - ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/
  1079.  
  1080.  
  1081.  
  1082.   Well I know there are a ton of other programs out there floating all 
  1083. over the net that, and maybe there are some that do a better job then 
  1084. these do, but these are the ones that I use and the ones I have found 
  1085. that work and are easy to use. As new program come out everyday, you 
  1086. have to keep on the lookout for what's new, and look for what's best for 
  1087. your needs.
  1088.  
  1089.  
  1090.  
  1091. ------------------------------------------------------------------------
  1092. 9. Conclusions
  1093.  
  1094.  
  1095.   Well, as you can see by the shear length of this paper that security 
  1096. for an operating system like Linux is not as simple as it may look. This 
  1097. paper has only touched on the basics of a lot of things you must know 
  1098. and get familiar with. This paper, if in depth, could of gone on to be a 
  1099. book (and I could of charged $50, hehehe), but as with all good papers, 
  1100. it's a work in progress. 
  1101.  
  1102.   The bottom line is you have to plan what your needs are going to be. 
  1103. You must implement you system to meet your needs, and then you have to 
  1104. be alert. The admin of a system is the bottom line when it comes to 
  1105. security. The admin must stay alert and watch his system, he must watch 
  1106. the security posts and mailing lists and must keep informed when new 
  1107. patches, kernels and programs come out. An admin must also keep their 
  1108. up-streams informed as well, and stay in good contact with them so they 
  1109. may trade valuable information with you so you both know what is going on. 
  1110. Heck, you can go on forever about what a good sys admin has to do to 
  1111. keep a secure system, but you have to start with knowing your system. I 
  1112. hope this paper has helped.
  1113.  
  1114. ------------------------------------------------------------------------
  1115.  
  1116.   PLEASE send me suggestions, tips and advice to help make this paper 
  1117. a better one! 
  1118.  
  1119.  
  1120. [EOF]
  1121.  
  1122.  
  1123.  
  1124.